package com.misty.blog.config;

import com.misty.auth.config.SecurityConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.userdetails.UserDetailsService;

/**
 *
 * @描述:
 */
@Configuration
public class BlogSecurityConfig extends SecurityConfiguration {

    @Autowired
    private UserDetailsService userDetailsService;

    @Override
    @Bean
    public UserDetailsService userDetailsService() {
        // 获取登录用户信息
        return username -> userDetailsService.loadUserByUsername(username);
    }
}
